package com.ljfresh.customer;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@EnableScheduling
public class CustomerApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(CustomerApplication.class, args);
    }

    @Override
    public void  addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("doc.html").addResourceLocations("classpath*:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath*:/META-INF/resources/webjars/");
    }
//    @Bean
////    public Docket createRestApi() {
////
////        ApiInfo apiInfo = new ApiInfoBuilder()
////                .title("乐家生鲜项目接口文档")
////                .description("乐家生鲜项目接口文档，符合RESTful API。")
////                .version("1.0")
////                .build();
////
////        return new Docket(DocumentationType.SWAGGER_2)
////                .apiInfo(apiInfo)
////                .select()
////                .apis(RequestHandlerSelectors.basePackage("com.ljfresh.customer.controller")) //以扫描包的方式
////                .apis(RequestHandlerSelectors.any()) //以扫描包的方式
////                .paths(PathSelectors.any())
////                .build();
////    }
}
